package com.bjpowernode.spring6.dynamicproxy.service;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class TimeHandler implements InvocationHandler {
    private UserService userService;
    public TimeHandler(UserService userService){
        this.userService = userService;
    }
    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("调到了invoke");
        Object res = method.invoke(userService, args);
        return res;
    }
}
